1. Field of Invention
The present invention pertains to the field of software systems. More particularly, this invention relates to a two tier arrangement for threads support in a virtual machine.
2. Art Background
Computer systems and devices having embedded processing resources are typically implemented in a variety of differing architectures. Each architecture is usually defined by a particular instruction set, hardware register set, and memory arrangement, etc. In addition, such computer systems and devices typically include an operating system which is adapted to its particular architecture. The operating system and architecture provide a platform for execution of software tasks.
Typically, software tasks such as application programs which are written or compiled to be executed on a particular platform may be referred to as native code. A software task in the native code of a particular platform usually does not run on other non compatible platforms.
A virtual machines is a software environment that enables application programs to execute on a variety of differing platforms. The application programs which execute under such a virtual machine usually take the form of a stream of instructions each of which conforms to a predefined instruction set supported by the virtual machine. A virtual machine implemented on a particular platform typically interprets each of the instructions in the stream and provides emulation of the instructions in the native code of the particular platform. In addition, a virtual machine may include threads support. Threads support may be defined as functionality that enables the parallel execution of multiple software tasks each of which is referred to as a thread.
One example of a virtual machine that enables application programs to execute on a variety of differing platforms and that provides threads support is a Java virtual machine. A typical Java virtual machine functions as an interpreter for Java application programs. A Java application program typically take the form of a stream of Java byte code instructions and the Java virtual machine emulates each Java byte code instruction using the native code of the particular platform under which the Java virtual machine executes. A typical Java virtual machine provides threads support which is defined by the java.lang.Thread class.
A typical virtual machine invokes various services provided by the operating system of the underlying platform including services that provide threads support. Typically, the nature and extent of such operating system services varies among operating systems. For example, some operating systems provide extensive threads support services while other operating systems provide little or no threads support services. In addition, the details of any threads support services usually varies widely among operating systems. Such variation in operating system services usually complicates the process of adapting a virtual machine to different platforms. Unfortunately, such complications usually increase the development time and cost of implementing virtual machines on different platform. Moreover, such complications usually increase the cost of software support for virtual machines on different platforms.